package cwinsor.raking.year2014;

public class PropertyPhysicalString extends PropertyPhysical {


	public void setPropertyValFromString(String string) {

		// sanity check - look for a null input
		if (string.equals(null)) {
			Msg.fatal(dM + ":hold everything - you are trying to set String property where the string text is null!");
		}

		// set the base class Object
		object = string;
	}

	public PropertyBase prototype() {
		PropertyBase prototype = new PropertyPhysicalString();
		return prototype;
	}

	public Object getValue() {
		return toString();
	}

	public Integer toInteger() {
		Msg.fatal(dM + ": this is a String property - it cannot be represented as Integer");
		return null;
	}

	public String toString() {
		String temp = (String)object;
		return temp;
	}

	public int compareTo(PropertyBase o) {
		return this.toString().compareTo(o.toString());
	}


	// debug
	String dM = this.getClass().getSimpleName();
}
